load(
    "//bazel:tachyon_cc.bzl",
    "tachyon_cc_library",
    "tachyon_cc_unittest",
)

package(default_visibility = ["//visibility:public"])

tachyon_cc_library(
    name = "binary_merkle_hasher",
    hdrs = ["binary_merkle_hasher.h"],
)

tachyon_cc_library(
    name = "binary_merkle_proof",
    hdrs = ["binary_merkle_proof.h"],
)

tachyon_cc_library(
    name = "binary_merkle_tree_storage",
    hdrs = ["binary_merkle_tree_storage.h"],
)

tachyon_cc_library(
    name = "binary_merkle_tree",
    hdrs = ["binary_merkle_tree.h"],
    deps = [
        ":binary_merkle_hasher",
        ":binary_merkle_proof",
        ":binary_merkle_tree_storage",
        "//tachyon/base:bits",
        "//tachyon/base:logging",
        "//tachyon/base:openmp_util",
        "//tachyon/base:range",
        "//tachyon/base/numerics:checked_math",
        "//tachyon/crypto/commitments:vector_commitment_scheme",
        "@com_google_googletest//:gtest_prod",
    ],
)

tachyon_cc_library(
    name = "simple_binary_merkle_tree_storage",
    testonly = True,
    hdrs = ["simple_binary_merkle_tree_storage.h"],
    deps = [":binary_merkle_tree_storage"],
)

tachyon_cc_unittest(
    name = "binary_merkle_tree_unittests",
    srcs = ["binary_merkle_tree_unittest.cc"],
    deps = [
        ":binary_merkle_tree",
        ":simple_binary_merkle_tree_storage",
        "//tachyon/base/containers:container_util",
    ],
)
